@header0: header0;

.@{header0} {
  position: fixed;
  top: 0;
  z-index: 1;
  width: 100%;
  background: @template-nav-bg-color;
  box-shadow: 0 5px 8px fade(#000, 15);

  .home-page {
    padding: 0 24px;
  }

  &-logo {
    position: relative;
    display: inline-block;
    width: 150px;
    line-height: 64px;

    & img {
      display: inline-block;
      vertical-align: middle;
    }

    & a {
      display: block;
    }
  }

  &-menu {
    float: right;

    .ant-menu {
      height: 64px;
      line-height: 62px;

      a {
        display: block;
      }
    }
  }

  &-item {
    &-block {
      padding: 0 8px;

      > * {
        display: inline-block;
      }
    }
  }

  &-item,
  &-item-child,
  &-menu {
    .ant-menu-sub .ant-menu-item,
    .ant-menu-inline .ant-menu-item {
      height: auto;
      line-height: 1.5;
    }

    .item {
      &-sub-item {
        display: block;
        padding: 8px 24px;
      }

      &-image {
        position: relative;
        z-index: 1;
        float: left;
        margin-top: 4px;
        margin-right: 16px;
      }

      &-title {
        margin-left: 46px;
        color: #fff;
        font-size: 14px;
      }

      &-content {
        margin-left: 46px;
        color: fade(#fff, 75);
        font-size: 12px;
      }
    }
  }
}

@media screen and (max-width: 767px) {
  .@{header0} {
    &-logo {
      z-index: 101;
    }

    &.home-page-wrapper .home-page {
      padding: 0 24px;
    }

    &-menu {
      position: relative;
      left: -24px;
      float: inherit;
      width: ~'calc(100% + 48px)';
      height: auto;
      opacity: 0;
      transition: opacity 0.3s @ease-in-out;

      & li {
        padding: 0 24px;

        &.ant-menu-submenu {
          padding: 0;
        }
      }
      .item {
        &-sub-item {
          padding: 8px 0;
        }
      }
    }

    &-mobile-menu {
      position: absolute;
      top: 24px;
      right: 24px;
      z-index: 100;
      width: 16px;
      height: 14px;
      cursor: pointer;

      em {
        display: block;
        width: 100%;
        height: 2px;
        margin-top: 4px;
        background: #fff;
        transition: transform 0.3s @ease-in-out, opacity 0.3s @ease-in-out;
      }

      :first-child {
        margin-top: 0;
      }
    }

    .ant-menu {
      height: auto;
      overflow: hidden;

      .ant-menu-item-selected {
        border: none;
      }
    }

    & .open {
      height: auto;

      .@{header0}-mobile-menu {
        em {
          &:nth-child(1) {
            transform: translateY(6px) rotate(45deg);
          }

          &:nth-child(2) {
            opacity: 0;
          }

          &:nth-child(3) {
            transform: translateY(-6px) rotate(-45deg);
          }
        }
      }

      > .@{header0}-menu {
        opacity: 1;
        pointer-events: auto;
      }
    }
    &-item-block {
      height: 40px;
      line-height: 40px;
    }
  }
}
